package progress.exa4;

import java.io.*;
import java.util.List;

public class ObjectInputStreamStudy {

    public static void main(String[] args) throws IOException, ClassNotFoundException {
        objectInputStreamStudy();
    }

    /**
     * 对象输入流学习
     */
    public static void objectInputStreamStudy() throws IOException {
        ObjectInputStream objInputStream = null;
        try{
            objInputStream = new ObjectInputStream(new FileInputStream("四郎"));
            List<String> result = (List<String>) objInputStream.readObject();
            System.out.println(result.toString());
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            if(objInputStream!=null) {
                objInputStream.close();
            }
        }

    }
}
